<template>
    <div class="top_box">
        <div class="index_box">
            <h1><router-link to="/"><img src="lib/images/logo.jpg" alt=""></router-link></h1>
            <ul class="nav_box">
                <li>
                    <router-link to="/" :class="routePath == '/' ? 'on' : ''">
                        <span>首页</span>
                        <span class="bkg"></span>
                    </router-link>
                </li>
                <li>
                    <router-link to="/about" :class="(routePath == '/about' || routePath == '/about/resort') ? 'on' : ''">
                        <span>关于智富</span>
                        <span class="bkg"></span>
                    </router-link>
                </li>
                <li>
                    <router-link id="hdyj" to="/active" :class="routePath == '/active' ? 'on' : ''">
                        <span>活动游记</span>
                        <span class="bkg"></span>
                    </router-link>
                </li>
                <li>
                    <router-link to="/travel/custom" :class="routePath == '/travel/custom' ? 'on' : ''">
                        <span>旅游定制</span>
                        <span class="bkg"></span>
                    </router-link>
                </li>
                <li>
                    <router-link to="/vip" :class="routePath == '/vip' ? 'on' : ''">
                        <span>VIP特权</span>
                        <span class="bkg"></span>
                    </router-link>
                </li>
                <li>
                    <router-link to="/hotel/list" :class="routePath == '/hotel/list' ? 'on' : ''">
                        <span>酒店租赁</span>
                        <span class="bkg"></span>
                    </router-link>
                </li>
                <li>
                    <router-link id="hwfc" to="/hotel/property" :class="routePath == '/hotel/property' ? 'on' : ''">
                        <span>海外房产</span>
                        <span class="bkg"></span>
                    </router-link>
                </li>
                <li>
                    <router-link to="/contact" :class="routePath == '/contact' ? 'on' : ''">
                        <span>联系我们</span>
                        <span class="bkg"></span>
                    </router-link>
                </li>
            </ul>
            <div class="phone_versions">
                <span class="ic_phone">手机端</span>
                <div class="code_pop" style="z-index: 10000;">
                    <span class="ic"></span>
                    <p class="code"><img src="lib/images/code.png" alt=""></p>
                    <p class="wz">智富微信服务号</p>
                </div>
            </div>
        </div>
    </div>
</template>


<script>
export default {
	data() {
		return {
			routePath: ''
		};
	},
	methods: {
	},
	/*watch: {
        '$route' (to, from) {alert(33);
            this.routePath = to.path;
            document.title = "智富环球-"+to.name;
		}
	},*/
	mounted: function() {
		this.routePath = this.$route.path;
		document.title = "智富环球-"+this.$route.name;
		var onli = null;
	    $(".nav_box>li>a").hover(function(){
	    	if(!onli){
	    		onli = $(".nav_box .on")
	    	}
	        $(".nav_box>li>a").removeClass("on");
	        $(this).addClass("on");
	    },function(){
	        $(this).removeClass("on");
	        onli.addClass("on");
	    });
	    
	    $(".common_code_pop>li").hover(function(){
	        $(this).find(".wx_con").animate({top:"0px"},300);
	    },function(){
	        $(this).find(".wx_con").animate({top:-$(this).find(".pt").height()+"px"},300);
	    });
	}
}
</script>
